﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using SharedGenomics.Core;
using SharedGenomics.Workbench.Core;

namespace SharedGenomics.Workbench.Views.WindowsForms
{
    public partial class FileBrowserView : View, IFileBrowserView
    {
        public FileBrowserView()
        {
            InitializeComponent();

            this.btBrowse.Click += (o, e) => { this.BrowseClicked.Raise(this); };
            this.btOpen.Click += (o, e) => { this.OpenClicked.Raise(this); };
            this.txtFilePath.TextChanged += (o, e) => { this.FilePathTextChanged.Raise(this); };
        }

        public string PromptText
        {
            get { return this.lbPrompt.Text; }
            set { this.lbPrompt.Text = value; }
        }

        public string FilePathText
        {
            get { return this.txtFilePath.Text; }
            set { this.txtFilePath.Text = value; }
        }

        public bool IsOpenEnabled
        {
            get { return this.btOpen.Enabled; }
            set { this.btOpen.Enabled = value; }
        }

        public event EventHandler BrowseClicked;
        public event EventHandler OpenClicked;
        public event EventHandler FilePathTextChanged;
    }
}
